class mpi_base_sequence extends uvm_sequence #(mpi_xaction);
	`uvm_object_utils(mpi_base_sequence)
	
	int seq_item_max_num;
	
	extern function new(string name = "mpi_base_sequence");
	extern virtual task pre_body();
	extern virtual task post_body();
endclass

function mpi_base_sequence::new(string name = "mpi_base_sequence");
	super.new(name);
	seq_item_max_num = 0;
endfunction

task mpi_base_sequence::pre_body();
	if(starting_phase != null)begin
		starting_phase.raise_objection(this);
	end
endtask: pre_body

task mpi_base_sequence::post_body();
	if(starting_phase != null)begin
		starting_phase.drop_objection(this);
	end
endtask:post_body

class mpi_default_sequence extends mpi_base_sequence;
	`uvm_object_utils(mpi_default_sequence)
	
	extern function new(string name = "mpi_default_sequence");
	extern virtual task body();
endclass

function mpi_default_sequence::new(string name = "mpi_default_sequence");
	super.new(name);
endfunction

task mpi_default_sequence::body();
	void '(uvm_config_db #(int)::get(null, get_full_name(), "seq_item_max_num", this.seq_item_max_num));
	`uvm_info(get_type_name(),$sformatf("body(): seq_item_max_num is %0d", this.seq_item_max_num),UVM_HIGH);
	
	repeat(this.seq_item_max_num) begin
		`uvm_do(req)
	end
	#10us;
endtask: body

class mpi_sanity_sequence extends mpi_base_sequence;
	`uvm_object_utils(mpi_sanity_sequence)
	
	ral_block_blk_dt003 reg_model;
	extern function new(string name = "mpi_sanity_sequence");
	extern virtual task body();
endclass

function mpi_sanity_sequence::new(string name = "mpi_sanity_sequence");
	super.new(name);
endfunction

task mpi_sanity_sequence::body();
	uvm_status_e status;
	logic[31:0] reg_value;
	
	begin
		repeat(20) @harness.clk_100;
		///reg_model.mode_sel.read(status,reg_value,UVM_FRONTDOOR);///xky_temp
		///`uvm_info(get_type_name(),$sformatf("reg mode_sel initail: DUT = %h", reg_value),UVM_NONE);
		///
		///reg_model.mode_sel.write(status,8'h55,UVM_FRONTDOOR);
		///
		///repeat(20) @harness.clk_100;
		///reg_model.mode_sel.read(status,reg_value,UVM_FRONTDOOR);
		///`uvm_info(get_type_name(),$sformatf("reg mode_sel initail: DUT = %h", reg_value),UVM_NONE);
		///
		///reg_model.mode_sel.write(status,8'hAA,UVM_FRONTDOOR);
		///
		///repeat(20) @harness.clk_100;
		///reg_model.mode_sel.read(status,reg_value,UVM_FRONTDOOR);
		///`uvm_info(get_type_name(),$sformatf("reg mode_sel initail: DUT = %h", reg_value),UVM_NONE);
		///reg_model.mode_sel.read(status,reg_value,UVM_FRONTDOOR);
		///`uvm_info(get_type_name(),$sformatf("reg mode_sel : DUT = %h", reg_value),UVM_NONE);	
	end
endtask: body

